let path = require("path");
let filepath = "a/b/c/a.txt";
console.log(path.parse(filepath));//解析文件
//{ root: '', dir: 'a/b/c', base: 'a.txt', ext: '.txt', name: 'a' }
console.log(path.extname(filepath))  //解析后缀  //.txt

//path.join("参数序列") 拼接路径的 正确拼接路径
let s = path.join("a/b/c/d","a.txt");
console.log(s);//a\b\c\d\a.txt  会自动转成系统识别的路径0